import sdljava.SDLException;
import sdljava.event.*;


public class MissionDetail extends Location{
	
	public MissionDetail(GameWindow gameWindow, String imageFile) throws SDLException {
		super(gameWindow, imageFile);
		populateSVector();
	}

	public void populateSVector() throws SDLException{
		//button sprites are created
		ImageData Menudimensions = new ImageData(2, horizontal, 363, 113, 0, 0);
		ImageData Okaydimensions = new ImageData(2, horizontal, 363, 113, 0, 0);
		
		ButtonSprite tempSprite = new ButtonSprite(gameWindow, Menudimensions, 815, 470, "bitmaps/popup_button_sprite.bmp");
		buttons.add(tempSprite);
		tempSprite = new ButtonSprite(gameWindow, Okaydimensions, 815, 600, "bitmaps/success fail buttons.bmp");
		buttons.add(tempSprite);
	}
	
	public void handleEvent(SDLEvent event) throws SDLException{
		if(event.getType() == SDLEvent.SDL_MOUSEMOTION){
			for(int i = 0; i < buttons.size(); i++){
				buttons.get(i).spriteHandle(event);
			}
		}
		if(event.getType() == SDLEvent.SDL_MOUSEBUTTONDOWN){
			for(int i = 0; i < buttons.size(); i++){
				if(buttons.get(i).spriteHandle(event) == true){
					if(i == 1){
						changeLocation = 2;
					}
					else{
						changeLocation = 1;
					}
				}
			}
		}
	}
}
